// C05:5.11:compstr1.cpp -- comparing strings using arrays
#include <iostream>
#include <cstring>    // prototype for strcmp()

int main(void)
{
    using namespace std;
    char word[5] = "?ate";
    for (char ch = 'a'; strcmp(word, "mate"); ch++)
    {// if word equal to "mate", then break
        cout << word << endl;
        word[0] = ch;
    }
    cout <<"After loop ends, word is " << word << endl;
}